const path = require('path')
const merge = require('webpack-merge');
const Dotenv = require('dotenv-webpack');
const common = require('./webpack.common');

module.exports = merge(common, {
    devtool: 'cheap-module-eval-source-map',
    plugins: [
        new Dotenv(),
    ],
    devServer: {
        port: 5000,
        proxy: {
            "/api": {
                target: "http://localhost:8080",
                pathRewrite: { "^/api": "" }
            }
        },
        contentBase: false,
        compress: true, // enable gzip compression
        historyApiFallback: false, // true for index.html upon 404, object for multiple paths
        hot: true, // hot module replacement. Depends on HotModuleReplacementPlugin
        https: false, // true for self-signed, object for cert authority
        noInfo: true, // only errors & warns on hot reload
    },
});
